The Sitecore web.config file includes a list of served web sites listed in the <sites> section. Each site is described with a <site> tag which includes a number of attributes. Sitecore determines the site context based on the incoming URL and the following two attributes:
Sitecore determines the site the following way:
Note that Sitecore checks for sites in the order in which they are included in the list. Thus, the "website" site should most likely be one of the last entries in the list, because it is the most general entry and matches all URLs in the site.